package com.zhouheng.springbootdesignpattern.archetypalpattern;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

/**
 * 浅克隆
 *
 * @author 周恒
 * @date 20190329 17:16:59
 * @since v1.0
 */
@Data
@AllArgsConstructor
public class Shallow implements Cloneable {

    private String name;

    private Integer age;

    private boolean marriage;

    private List<String> interest;

    private Car car;

    @Override
    public Shallow clone() {
        Shallow shallow = null;
        try {
            shallow = (Shallow) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return shallow;
    }

}
